<?php
if(is_array($result))
{
	header('Content-Type: application/json; Charset=UTF-8',true);
	//header("Content-Type: text/html;charset=utf-8");
	$jsonData = array('page'=>$o_MrpOrdenProduccionFN->page,'total'=>$o_MrpOrdenProduccionFN->numeroRegistros,'rows'=>array());
	foreach ($result as $key => $obj)
	{
		
	//If cell's elements have named keys, they must match column names
	//Only cell's with named keys and matching columns are order independent.
		$entry = array('id'=>$obj->getPdoOrdenId(),
		    'cell'=>array(
		            'ordenId' =>$obj->getPdoOrdenId(),
		            'clienteId'=>utf8_encode($obj->getClienteNombre()),
		            'productoId'=>utf8_encode($obj->getArticuloNombre()),			           
		            'cantProdc'=>$obj->getPdoCantidad(),
		            'fecProducIni'=>$obj->getPdoFechaProduccIni(),
		            'fecProducFin'=>$obj->getPdoFechaProduccFin(),
		            'fecReq'=>$obj->getPdoFechaReq(),
		            'almacenId'=>$obj->getPdoAlmacenId(),
		            //'opciones'=>"<img border='0' title='Detalle Receta' src='/gourmet-express/trunk/imgs/icons/application_view_list.png' onclick=fn_detalle('". $obj->getPdoOrdenId()."') style='cursor:pointer;'><img border='0' title='Editar Orden' src='/gourmet-express/trunk/imgs/icons/page_edit.png' onclick=fn_editar('". $obj->getPdoOrdenId()."') style='cursor:pointer;'><img border='0' title='Eliminar Orden' src='/gourmet-express/trunk/imgs/icons/delete_icon.png' onclick=fn_eliminar('". $obj->getPdoOrdenId()."') style='cursor:pointer;'>"
                            'opciones'=>"<img border='0' title='Editar Orden' src='/gourmet-express/trunk/imgs/icons/page_edit.png' onclick=fn_editar('". $obj->getPdoOrdenId()."') style='cursor:pointer;'>"
		    ),
		);
		$jsonData['rows'][] = $entry;
	}
	echo json_encode($jsonData);
}?>
	
	